package com.config.activemq;

import org.springframework.jms.annotation.JmsListener;
import org.springframework.stereotype.Component;

@Component
public class Listener {
    int count = 0;

    @JmsListener(destination = "order-mysql", concurrency = "10")
    public void messageHandle(String msg) {
        System.out.println(msg);
        System.out.println("消费了" + ++count + "条数据，存订单到mysql中");
    }
}